Skip to content

Undici migration p2#2813

Open
davidgamero wants to merge 10 commits intokubernetes-client:mainfrom
davidgamero:undici-migration-p2
Open

Undici migration p2#2813
davidgamero wants to merge 10 commits intokubernetes-client:mainfrom
davidgamero:undici-migration-p2

Conversation

@davidgamero
Copy link
Copy Markdown
Contributor

@davidgamero davidgamero commented Mar 26, 2026

node-fetch removals

  • rips out node-fetch and @types/node-fetch, uses native fetch (undici) everywhere
  • drops nock, migrates all test mocking to undici MockAgent
  • rewrite health, log, watch to use fetch() + Readable.fromWeb() for streaming
  • rename integration_test.ts → fullrequest_test.ts since it's a unit test

auth

  • removes applyToFetchOptions from kubeconfig (dead after migration)
  • cleans up dead tls config in applySecurityAuthentication (was set then immediately overwritten)

watch

  • treat watch TimeoutError as reconnectable in informer, add exponential backoff on reconnect
  • normalize timeout errors in watch.ts (fixes Node 23 mid-stream AbortError vs TimeoutError inconsistency)
  • add integration test for watch

informer

  • add informer reconnect integration test

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 26, 2026
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 26, 2026
@cjihrig
Copy link
Copy Markdown
Contributor

cjihrig commented Mar 26, 2026

This is really great progress on modernizing the project. Thanks for working on it.

@davidgamero
Copy link
Copy Markdown
Contributor Author

This is really great progress on modernizing the project. Thanks for working on it.

thanks! i was trying to remove nock so we can consolidate testing into undici mockagent and it snowballed

@davidgamero davidgamero force-pushed the undici-migration-p2 branch from 60b46b0 to 7a25b4f Compare March 27, 2026 21:04
Comment thread src/cache_test.ts Outdated
Comment thread src/test/integration/watchPods.ts
Comment thread src/test/integration/informerReconnect.ts Outdated
Comment thread src/test/integration/informerReconnect.ts Outdated
Comment thread src/test/integration/informerReconnect.ts Outdated
Comment thread src/config.ts
Comment thread src/watch_test.ts
@brendandburns
Copy link
Copy Markdown
Contributor

Generally looks good, some comments on sleep() usage in one of the tests and a couple of things that I'm not sure why they were removed.

@davidgamero davidgamero marked this pull request as ready for review April 1, 2026 05:38
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 3, 2026
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 7, 2026
Copy link
Copy Markdown
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM. I'll hold off on merging in case others want to weigh in first.

Comment thread src/cache.ts Outdated
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cjihrig, davidgamero

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [cjihrig,davidgamero]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Comment thread src/util.ts
@davidgamero davidgamero changed the title WIP Undici migration p2 Undici migration p2 Apr 13, 2026
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 13, 2026
@mstruebing
Copy link
Copy Markdown
Member

@davidgamero can/should we merge this?

@davidgamero
Copy link
Copy Markdown
Contributor Author

@davidgamero can/should we merge this?

yes all comments are addressed

in my view it is good to merge @mstruebing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants